<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>skeleton骨架屏css</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box1 {
            position: absolute;
            margin: 0 auto;
            left: 50%;
            margin-left: -400px;
            top: 0;
            width: 400px;
            height: 60px;
        }

        @keyframes loading {
            0% {
                background-position: -400px 0
            }

            100% {
                background-position: 400px 0
            }
        }

        .animatedSkeleton {
          background-image: linear-gradient(to right, #fff 0%, #dddddd 50%, #eeeeee 100%);
          animation: loading 2s ease 0s infinite;
        }

        .line1 {
            background-color: #fff;
            height: 20px;
            width: calc(100% - 40px);
        }

        .line2 {
            background-color: #fff;
            height: 20px;
            width: 50%;
        }

        .line3 {
            background-color: #fff;
            height: 20px;
            width: calc(100% - 40px);
        }

        .line4 {
            background-color: #fff;
            height: 20px;
            width: 50%;
        }

        .line5 {
            background-color: #fff;
            height: 20px;
            width: calc(100% - 40px);
        }
    </style>
</head>

<body>
    <!-- 骨架 -->
    <div class="box1">
        <div class="animatedSkeleton line1"></div>
        <div class="animatedSkeleton line2"></div>
        <div class="animatedSkeleton line3"></div>
        <div class="animatedSkeleton line4"></div>
        <div class="animatedSkeleton line5"></div>
    </div>
</body>

</html>